]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ScreenShield: ensure we don't leak logind inhibitors
authorRui Matos <tiagomatos@gmail.com>
Mon, 11 May 2015 13:59:24 +0000 (15:59 +0200)
committerRui Matos <tiagomatos@gmail.com>
Thu, 14 May 2015 13:11:16 +0000 (15:11 +0200)
This could happen if we are VT switched away and an animated
activation is requested because we're preparing to enter sleep. Since
we don't animate in this case we'd never reach
_completeLockScreenShown() before coming out of sleep, at which point
we _inhibitSuspend() again and would leak the previous inhibitor.

https://bugzilla.gnome.org/show_bug.cgi?id=749228

js/ui/screenShield.js

index 1cfc211774b6ce5cbafbdb0f09d51d9a4fcce4f2..d50113f88ef9eaabbeafc50fa3594dca094e5f2f 100644 (file)
@@ -667,6 +667,8 @@ const ScreenShield = new Lang.Class({
     _inhibitSuspend: function() {
         this._loginManager.inhibit(_("GNOME needs to lock the screen"),
                                    Lang.bind(this, function(inhibitor) {
+                                       if (this._inhibitor)
+                                           this._inhibitor.close(null);
                                        this._inhibitor = inhibitor;
                                    }));
     },